<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<H1>支付测试</H1>
<hr>
<div class="form-container">
  <form id="form" action="http://localhost:8022/alipay" method="post">
    *订单名称 :
    <input type="text" name="subject" value="支付宝支付测试"><br>
    *商品名称 :
    <input type="text" name="body" value="test"><br>
    *商品单价：
    <input type="text" name="prince" id="price" value="666" ><br>
    *商品数量：
    <input type="number" name="amount" id="amount" onchange="sum()" value="1"><br>
    *付款金额 :
    <input type="text" name="total_amount" id="total_amount" value="666"><br>
    <input type="submit" value="支付宝支付" >
  </form>
</div>

<script>
  function sum() {
    var price=document.getElementById("price")
    var amount=document.getElementById("amount")
    var total_amount=document.getElementById("total_amount")
    total_amount.value=price.value*amount.value
  }

</script>
</body>

<style>
  .form-container {
    padding-top:10px;
  }
  input {
    margin:10px;

  }
</style>
</html>

